package com.qian.service.ddj.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.*;

@Getter
@Setter
@ToString
@Entity
@Table(name = "ddj_user_business")
public class DdjUserBusiness {

    @EmbeddedId
    private DdjUserBusinessId id;
    @ColumnDefault("0")
    @Version
    private Integer version;

    @Column(insertable = false, updatable = false)
    private Integer userId;

    @ManyToOne
    @JoinColumn(name = "userId", insertable = false, updatable = false)
    private DdjUser user;
    @ManyToOne
    @JoinColumn(name = "businessId", insertable = false, updatable = false)
    private DdjBusiness business;

}
